package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantPsychologicalCaseWarningMapper;
import com.hgkj.cloud.base.domain.TenantPsychologicalCaseWarning;
import com.hgkj.cloud.base.service.TenantPsychologicalCaseWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class TenantPsychologicalCaseWarningServiceImpl implements TenantPsychologicalCaseWarningService {

    @Autowired
    private TenantPsychologicalCaseWarningMapper mTenantPsychologicalCaseWarningMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return mTenantPsychologicalCaseWarningMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TenantPsychologicalCaseWarning record) {
        return mTenantPsychologicalCaseWarningMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantPsychologicalCaseWarning record) {
        return mTenantPsychologicalCaseWarningMapper.insertSelective(record);
    }

    @Override
    public TenantPsychologicalCaseWarning selectByPrimaryKey(Long id) {
        return mTenantPsychologicalCaseWarningMapper.selectByPrimaryKey(id);
    }

    @Override
    public TenantPsychologicalCaseWarning selectByPrimaryCounselingId(Long CounselingId) {
        return mTenantPsychologicalCaseWarningMapper.selectByPrimaryCounselingId(CounselingId);
    }

    @Override
    public int updateByPrimaryKeySelective(TenantPsychologicalCaseWarning record) {
        return mTenantPsychologicalCaseWarningMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantPsychologicalCaseWarning record) {
        return mTenantPsychologicalCaseWarningMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Map<String, Object>> getWarningList(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return mTenantPsychologicalCaseWarningMapper.getWarningList(map);
    }

    @Override
    public long getWarningListCount(Map<String, Object> map) {
        return mTenantPsychologicalCaseWarningMapper.getWarningListCount(map);
    }

    @Override
    public Map<String, Object> statWarningStatus(Map<String, Object> map) {
        return mTenantPsychologicalCaseWarningMapper.statWarningStatus(map);
    }

    @Override
    public Double getAverageProcessCycle(Map<String, Object> map) {
        return mTenantPsychologicalCaseWarningMapper.getAverageProcessCycle(map);
    }

    @Override
    public List<Map<String, Object>> getUserWarning(PageInfo pi,Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return mTenantPsychologicalCaseWarningMapper.getUserWarning(map);
    }

    @Override
    public Long getUserWarningCount(Map<String, Object> map) {
        return mTenantPsychologicalCaseWarningMapper.getUserWarningCount(map);
    }

    @Override
    public Long getAllUserWarningCount(Map<String, Object> map) {
        return mTenantPsychologicalCaseWarningMapper.getAllUserWarningCount(map);
    }
}
